/** ###################################################################
**     Filename  : Drv.H
**     Project   : CyberPark
**     Processor : MC9S12XS128MAL
**     Compiler  : CodeWarrior HCS12X C Compiler
**     Date/Time : 2011-7-31, 23:03
**     Contents  :
**         User source code
**
**     (c) Copyright UNIS, a.s. 1997-2008
**     UNIS, a.s.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

#ifndef __Drv_H
#define __Drv_H

/* MODULE Drv */

#include "Types.h"
#include "DRV_BACK.h"
#include "DRV_TIMER.h"
#include "DRV_MEN.h"
#include "DRV_SERVO.h"
#include "DRV_PWM.h"

#define DRV_FRONT (0)
#define DRV_FRONT_BACK  (1)
#define DRV_SERVO_MIDDLE_DEFAULT	(1620)  //new 20130324
#define DRV_SERVO_LEFT_DEFAULT	(1170) //new 20130317
#define DRV_SERVO_RIGHT_DEFAULT	(1860) //new 20130317
#define DRV_SERVO_WEIGHT_OLD	(9)
#define DRV_SERVO_WEIGHT_NEW	(1)
#define DRV_SERVO_WEIGHT_ALL	(DRV_SERVO_WEIGHT_OLD + DRV_SERVO_WEIGHT_NEW)

extern volatile int DrvpEnableControl;
extern U16 DrvServoMiddle;
extern U16 DrvServoLeft;
extern U16 DrvServoRight;

void DrvEnableMotorControl(void);
void DrvDisableMotorControl(void);
void DrvSetSpeedMotor(S16 speed);
void DrvIrqHandler(void);
void DrvSetPidChoice(U8 choice);

void DrvpSetPwmMotor(S16 pwm);

void DRV_SERVO_SetDuty(U16 duty);

void DrvFreezeMotorControl(void);
void DrvRestoreMotorControl(void);
void DrvServoIrqHndler(void);

/* END Drv */

#endif

